<div class="g12 nodrop" style="margin-bottom: 43px;">

    <h1>Pregled članaka</h1>

    <p style="line-height: 13px;">Možete pregledati sve članke.<br />Samo sopstvene možete ažurirati</p>

    <div class="ex_highlight_row grid">

        <table class="datatable border" cellpadding="0" cellspacing="0" id="example">

            <thead>                      
                <tr style="background-image: url(<?=$url?>assets/img/sort_row_bg.gif); background-repeat: repeat-x; background-position: 0 0 ;">
                    <!--<th>id</th><th>Slika</th>--><th>Naslov</th><th>Rubrika</th><th>Autor</th><th>Objavljen</th><th>Status</th><th>Akcija</th>
                </tr>
            </thead>

            <tbody>

                <? 
                    foreach($article as $row){?>

                    <tr>
                        <!--<td style="text-align: center; vertical-align: middle; width: 30px; line-height: 11px;"><?=$row['article_id']?></td>-->
                        <!--     <td align="left" height="23" style="vertical-align:top; padding: 3px 3px;">
                        <div style="line-height: 0; font-size: 0">
                        <img src="<?=$url.'tempatt/'.$row['media_filepath']?>" height="23" />
                        </div>
                        </td>       -->
                        <td style="text-align: left; vertical-align: middle;  line-height: 11px;">
                            <? if(strlen($row['article_title'])>53 ) {echo mb_substr($row['article_title'], 0, 53, 'UTF-8').'...';}else {echo $row['article_title'];}?></td>
                        <td style="text-align: left; vertical-align: middle; font-size: 11px; "><? if($row['column_name']!=null){echo $row['column_name'].' / '.$row['subcolumn_name'];}?></td>
                        <td style="text-align: left; vertical-align: middle; font-size: 11px;"><?=$row['user_fname'].' '.$row['user_lname']?></td>
                        <td style="vertical-align: middle; font-size: 11px;"><?= date('d.m.Y - H:i', $row['article_datepublish'])?> h</td>
                        <?
                            $status = '';
                            switch($row['article_status']){
                                case -1: $status = 'closed'; break;
                                case 0: $status = 'closed'; break;
                                case 1: $status = 'open'; break;
                                case 2: $status = 'closed'; break;
                                case 3: $status = 'closed'; break;
                                case 4: $status = 'open'; break;
                            }
                        ?>
                        <td style="vertical-align: middle; text-align: center;" id="status-<?=$row['article_id']?>"><img src="<?=$url?>assets/img/backgnds/item-<?=$status?>.png" /></td>
                        <td style="vertical-align: middle;">
                            <a href="<?=$url?>article/articlepreview?id=<?=$row['article_id']?>" class="small" id="<?=$row['article_id']?>">Pogledaj</a> |
                            <a href="<?=$url?>article/editform?id=<?=$row['article_id']?>" class="small" id="<?=$row['article_id']?>">Uredi</a> 
                            <? if($this->session->userdata('typeofuser_id')!= 'LT') {?>
                                | <a href="javascript:" class="deletearticle small" id="<?=$row['article_id']?>">Obriši</a>
                                | <a href="javascript:" class="articlestatus small" id="<?=$row['article_id']?>"><? if($status=='open'){echo 'Deaktiviraj';}else echo 'Aktiviraj'; ?></a>
                            <?}?>
                        </td> 
                    </tr>    

                    <?}

                ?>

            </tbody>

        </table>

    </div>

</div>
